package com.kun.service.impl;

import com.kun.dao.DeptDao;
import com.kun.entity.Dept;
import com.kun.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeptServiceImpl implements DeptService {

    @Autowired
    private DeptDao deptMapper;

    public int insertDept(Dept dept) {
        return deptMapper.insertDept(dept);
    }

    public int deleteDept(Long id) {
        return deptMapper.deleteDept(id);
    }

    public int updateDept(Dept dept) {
        return deptMapper.updateDept(dept);
    }

    public Dept getDeptById(Long id) {
        return deptMapper.getDeptById(id);
    }

    public List<Dept> queryAllDepts() {
        return deptMapper.queryAllDepts();
    }
}
